package com.ruoyi.project.system.mapper;

import java.util.List;
import java.util.Map;

import com.ruoyi.project.system.domain.CollegePaperAnswer;
import org.apache.ibatis.annotations.Select;

/**
 * 学院试卷答题Mapper接口
 * 
 * @author ruoyi
 * @date 2020-11-19
 */
public interface CollegePaperAnswerMapper 
{
    /**
     * 查询学院试卷答题
     * 
     * @param id 学院试卷答题ID
     * @return 学院试卷答题
     */
    public CollegePaperAnswer selectCollegePaperAnswerById(Long id);

    /**
     * 查询学院试卷答题列表
     * 
     * @param collegePaperAnswer 学院试卷答题
     * @return 学院试卷答题集合
     */
    public List<Map<String,Object>> selectCollegePaperAnswerList(CollegePaperAnswer collegePaperAnswer);

    /**
     * 新增学院试卷答题
     * 
     * @param collegePaperAnswer 学院试卷答题
     * @return 结果
     */
    public int insertCollegePaperAnswer(CollegePaperAnswer collegePaperAnswer);

    /**
     * 修改学院试卷答题
     * 
     * @param collegePaperAnswer 学院试卷答题
     * @return 结果
     */
    public int updateCollegePaperAnswer(CollegePaperAnswer collegePaperAnswer);

    /**
     * 删除学院试卷答题
     * 
     * @param id 学院试卷答题ID
     * @return 结果
     */
    public int deleteCollegePaperAnswerById(Long id);

    /**
     * 批量删除学院试卷答题
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteCollegePaperAnswerByIds(Long[] ids);

    @Select("select score from college_paper_answer where college_paper_id=#{id} and student_id=#{collegeId}")
    Map<String, Object> getAnswer(Integer collegeId, Integer id);
}
